home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98c.txt
/
000105_icon-group-sender _Mon Dec 7 17:04:40 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA19280
for icon-group-addresses; Mon, 7 Dec 1998 17:02:55 -0700 (MST)
Message-Id: <199812080002.RAA19280@baskerville.CS.Arizona.EDU>
Date: Mon, 7 Dec 1998 14:59:00 -0700
From: swampler@noao.edu (Steve Wampler)
Subject: Re: Past Keyword / Coexpr Help
To: icon-group@optima.CS.Arizona.EDU
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
MJE wrote:
> I like Steve Wampler's answer. Since "find" is a generator, presumably
> this function will also behave as a generator. I would still lobby for
> the "past" keyword, but no complaints.
>
> Mark
>
>
> Steve Wampler wrote:
> >
> > You can write your own string analysis function to implement past().
> >
> > As I understand what you want, the following would work:
> >
> > procedure past(s)
> > suspend (tab(find(s)),match(s))
> > end
> >
>
> Nevin Liber wrote:
> >
> >
> > It has find(), and it is fairly trivial to write past() using find. Here
> > you go:
> >
> > procedure past(s1, s2, i1, i2)
> >
> > suspend find(s1, s2, i1, i2) + *s1
> >
> > end
The advantage Nevin's has is that it behaves exactly the same as the other string
analysis functions (i.e. you can supply the last three arguments and use it outside
of string scanning). It's probably slightly faster as well, but I doubt the difference
would be noticable to most of us.
A compromise is:
procedure past(s1,s2,i,j)
suspend (find(s1,s2,i,j),match(s1))
end
--
Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)]
The gods that smiled at your birth are now laughing openly. (Fortune Cookie)